home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / dhhelper.zip / DEMO1.PAS < prev    next >
Pascal/Delphi Source File  |  1990-06-12  |  2KB  |  60 lines

  1. Program Demo1;
  2.  
  3. {===========================================================================}
  4. {
  5. {  This program shows how to use Help files in Turbo Pascal programs.
  6. {  Run the program with Turbo Pascal 4.0 or higher, making sure the units
  7. {  HELP.TPU, DOSSHELL.TPU and LIBRARY1.TPU are in the current directory, or
  8. {  in the unit path.
  9. {
  10. {  You will be prompted to enter a filename - type in the full filename of
  11. {  a help file created previously with The Helper. (eg. demo1.hlp)
  12. {
  13. {===========================================================================}
  14.  
  15. {$M $4000,0,$4000}  {Set max heap size. This is required only if the *.hlp }
  16.                     {help files you use make use of the DOS shell facility.}
  17.                     {The stack and heap values should be at least as shown.}
  18.  
  19. uses crt, help;     {To allow access to screen and Help utilities}
  20.  
  21. Var
  22.   FileName : String;  {The file name of the compiled help file to use}
  23.  
  24. Procedure Get_Help;
  25. {-----------------------------------------------------------------------}
  26. {The recommended way to use Help is through a procedure such as this:
  27. {Use The Helper, after checking that it has been correctly initialised.
  28. {-----------------------------------------------------------------------}
  29. Begin
  30.   SaveHelpBG;  {Save the background so that it can be restored between  }
  31.                {displaying successive Help screens, which may overlap or}
  32.                {be of different sizes. If you don't have this statement }
  33.                {each screen will simply be overlayed over the previous  }
  34.                {screen, and when you exit from Use_Help() the last Help }
  35.                {screen will be left displayed.                          }
  36.  
  37.   If not HelpInitialised then Initialise_Help(FileName);
  38.   If HelpInitialised then Use_Help(HelpCat);
  39.   RestoreHelpBG;  {Restore the saved screen before returning}
  40. End;
  41.  
  42. BEGIN
  43. {--------Request a help file name}
  44.   Write('The Helper. Enter full filename: ');
  45.   Readln(FileName); If FileName='' then Halt;
  46.  
  47. {-------Clear screen, and use the help file}
  48.   ClrScr;
  49.   Get_Help;
  50.  
  51. {-------Write a message if not successful}
  52.   If not HelpInitialised then begin
  53.     Write('Help file ',Filename,' not initialised.  Press Enter..');
  54.     Readln;
  55.   End;
  56.  
  57. {-------Clear screen and end}
  58.   ClrScr;
  59. END.
  60.